package com.tqffram.hibernate.service.impl;

import com.tqffram.hibernate.entitry.Person;
import com.tqffram.hibernate.mapper.PersonRepository;
import com.tqffram.hibernate.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: 唐祺峰
 * @Date: 2022/2/15 0015 17:02
 * @Version 1.0
 */
@Service
public class PersonServiceImpl implements PersonService {

    @Autowired
    private PersonRepository personRepository;

    public Person findById(Long id){
        return personRepository.findById(id);
    }

    public Person findByName(String name){
        return personRepository.findByName(name);
    }

    public void save(Person person){
        personRepository.save(person);
    }

}
